package com.tsystems.lection12.entities;

// Generated 25.11.2013 11:52:16 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Teacher generated by hbm2java
 */
@Entity
@Table(name = "TEACHER", schema = "PUBLIC", catalog = "PUBLIC")
public class Teacher implements java.io.Serializable {

	private Integer id;
	private User user;
	private Integer experience;
	private Set<TeacherCourse> teacherCourses = new HashSet<TeacherCourse>(0);
	private Set<TeacherReview> teacherReviews = new HashSet<TeacherReview>(0);

	public Teacher() {
	}

	public Teacher(User user) {
		this.user = user;
	}

	public Teacher(User user, Integer experience,
			Set<TeacherCourse> teacherCourses, Set<TeacherReview> teacherReviews) {
		this.user = user;
		this.experience = experience;
		this.teacherCourses = teacherCourses;
		this.teacherReviews = teacherReviews;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "EXPERIENCE")
	public Integer getExperience() {
		return this.experience;
	}

	public void setExperience(Integer experience) {
		this.experience = experience;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<TeacherCourse> getTeacherCourses() {
		return this.teacherCourses;
	}

	public void setTeacherCourses(Set<TeacherCourse> teacherCourses) {
		this.teacherCourses = teacherCourses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "teacher")
	public Set<TeacherReview> getTeacherReviews() {
		return this.teacherReviews;
	}

	public void setTeacherReviews(Set<TeacherReview> teacherReviews) {
		this.teacherReviews = teacherReviews;
	}

}
